const state = {
	username: null, // 当前登录人工号
	nickname: "谭德权", // 当前登录人昵称
	avatar: "", // 当前登录人头像
	role: [], // 当前登录人角色
	token: null, // 当前登录密钥
}

// 同步设置store.state
const mutations = {
	SET_USERNAME: (state, data) => {
		state.username = data
	},
	SET_NICKNAME: (state, data) => {
		state.nickname = data
	},
	SET_AVATAR: (state, data) => {
		state.avatar = data
	},
	SET_ROLE: (state, data) => {
		state.role = data
	},
	SET_TOKEN: (state, data) => {
		state.token = data
	},
}

// 异步设置store.state
const actions = {}

export default {
	namespaced: true,
	state,
	mutations,
	actions,
}
